package com.forekonw.deomlianxi;

import java.util.Scanner;

public class Testther {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        boolean isRight = false;
        String name = " ";
        String mima = " ";
        String noa = "y";
        int nob = 0;
        int suiji = (int) Math.random() * 10000;

        do {
            System.out.println("*************");
            System.out.println("1.注册");
            System.out.println("2.登录");
            System.out.println("3.抽奖");
            System.out.println("*************");
            System.out.println("请选择");
            nob = input.nextInt();
            switch (nob){
                case 1:
                    System.out.println("1.注册");
                    System.out.println("请输入用户名");
                    name = input.next();
                    System.out.println("请输入密码");
                    mima = input.next();
                    System.out.println(name + "  " +mima+"  " +suiji);
                    isRight = true;
                    break;
                case 2:
                    if (isRight){
                        for (int i =1;i<=3;i++){
                            System.out.println("2.登录");
                            System.out.println("输入登录的用户名");
                            String name1 = input.next();
                            System.out.println("请输入登录密码");
                            String mima1 = input.next();
                            if (name==name1&&mima==mima1){
                                System.out.println("welcome:  + name");
                            }else {
                                System.out.println("用户名密码错误");
                            }
                        }
                    }
                    break;
            }
        }while (nob!=1);
    }
}
